﻿@using SCMS.Resource
@model SCMS.UI.Models.TransferAsset
@{string intial = "if (document.getElementById('table') != null) {initSorter();sorter.size(20);}CloseDialog();";}
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "AssetsDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action("TransferAsset"),
      //OnBegin = string.Format("usermsgg('{0}');", Resources.OrderRequest_AddItemInEditMode_SuccessMsg),
      OnSuccess = intial + string.Format(" usermsg('{0}');", "process complete")
  };}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{
    @Html.ValidationSummary(true)
    @Html.HiddenFor(x => x.EntityAssetManagement.AssetId)
     
    <table width="600px" align="center" cellpadding="2">
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_morgan.GoodsReceivedNote_LoadTransferAsset_HandedTo
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityAssetManagement.ManagementAction, new SelectList(
                new List<Object>{ 
                    new { value = "Partner" , text = Resources_morgan.GoodsReceivedNote_LoadTransferAsset_Partner  },
                    new { value = "Internal Transfers" , text = Resources_morgan.GoodsReceivedNote_LoadTransferAsset_InternalTransfers }
                }, "value", "text"), Resources.Global_String_PleaseSelect, new { onchange = "javascript:SwitchDisplay(this)" })
                @Html.ValidationMessageFor(x => x.EntityAssetManagement.ManagementAction)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center" width="33.3%">
                @Resources_morgan.GoodsReceivedNote_LoadTransferAsset_CurrentProPatnar
            </td>
        </tr>
        <tr id="handedoverid" style="display: none;">
            <td align="center" valign="top">
                @Html.TextBoxFor(x => x.EntityAssetManagement.PartnerName)
                @Html.ValidationMessageFor(x => x.EntityAssetManagement.PartnerName, Resources.Global_String_Required)
            </td>
        </tr>
        <tr id="currentprojectid" style="display: none;">
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityAssetManagement.currentProjectId, Model.ProjectDonors, Resources.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityAssetManagement.currentProjectId)
            </td>
        </tr>
        <tr>
            <td align="center">
                <input type="submit" class="btn green" value="@Resources.Global_String_SaveChanges" />
            </td>
        </tr>
    </table>
}
